/**
 * Created by lx on 2017/9/15.
 */
angular.module('module.charge', [
        'ngStorage',
        'service.charge',
    ])
    .config(['$stateProvider', function ($stateProvider) {
        $stateProvider
            // 店铺优惠券详情
            .state('charge', {
                url: '/charge/main',
                templateUrl: charge_view_url + 'charge.html',
                controller: 'ChargeMainController',
                controllerAs: 'vm',
            })
            .state('turnover', {
                url: '/charge/turnover',
                //resolve: {
                //    turnoverList: ['$q','$localStorage', function ($q,$localStorage) {
                //        var shopid = $localStorage.shopid;
                //        var deferred = $q.defer();
                //        var page = {
                //            num: "",
                //            n: ""
                //        };
                //        var time_start = new Date(new Date().getFullYear(), new Date().getMonth() - 1, new Date().getDate(), 0, 0, 0).getTime();//1个月前的时间戳
                //        var time_end = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 23, 59, 59).getTime();//今天的时间戳
                //        AnalysisService.getlongtiomorder(shopid, null, null, null, null, time_start, time_end, page).$promise.then(function(success){
                //            deferred.resolve(success);
                //        },function(error){
                //            deferred.resolve("undefined");
                //        });
                //        return deferred.promise;
                //    }]
                //},
                templateUrl: charge_view_url + 'turnover.html',
                controller: 'ChargeTurnoverController',
                controllerAs: 'vm',
            })
    }]);
